package edu.gatech.cs4235.group3.domain;

import java.util.Random;

/**
 * This is a one time pad generation class. You can call this in order to create
 * customized one time pads. Also, the right side of the pad is always the space
 * character.
 * 
 * 
 * @author Jeffrey Starker
 *
 */
public class GeneratedOneTimePad extends Message {
	
	/**
	 * Generates a one time pad.
	 */
	public GeneratedOneTimePad() {
		
		super();
		
		Random random = new Random();
		
		char[][] padText = this.getText();
		
		// Generate the one time pad.
		for (int i = 0; i < padText.length; i++) {
			
			for (int j = 0; j < padText[0].length; j++) {
				
				if (j == (padText[0].length - 1)) {
					padText[i][j] = ' ';
				} else {
					padText[i][j] = (char) (random.nextInt(95) + 32);
				}
			}
		}
		
	}

}
